<?php FrontDialog::registerAssetFiles('idialog')?>
<div class="bh-content">
		<div class="bh-ly-jj-uppw_con bh-padT10">
		<!-- 个人中心左侧导航 -->
			<?php $this->renderPartial('application.views.partials.personal.personal')?>
			<div class="bh-pj-jp-right-two bh-ly-jj-pw_right font_cr4 bh-Border_1 bh-fr" style="height:auto">
				<h3>机票订单</h3>
				<div class="bh-ly-jj-vieworder bh-mtop15">
					<?php $this->widget('lib.ext.data.DataWidget',array(
                           	'model' => $model,
                            'view' => 'application.modules.mall.views.center.search'
                      ))?>
                    <table class="bh-mTop20 bh-Border_2 " width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr height="30" class="bh-ly-jj-borderB0">
                        <th width="8%">订单编号</th>
                        <th width="12%">航班信息</th>
                        <th width="12%">航班时间</th>
                        <th width="12%">下单时间</th>
                        <th width="8%">收货人</th>
                        <th width="10%">价格</th>
                        <th width="10%">订单状态</th>
                        <th width="10%">支付状态</th>
                        <th width="14%">操作</th>
                      </tr>
                      <?php foreach ($data->data as $one):?>
                          <tr height="75" class="bh-textCt">
                            <td><?php echo CHtml::value($one, 'sn')?></td>
                            <td><?php echo CHtml::value($one, 'items.goods.title')?></td>
                            <td><?php echo CUtilHelper::date()->changeFormat(CHtml::value($one, 'items.goods.profile.departure_time'), 'Y-m-d H:i')?></td>
                            <td><?php echo CUtilHelper::date()->changeFormat($one->create_time, 'Y-m-d')?></td>
                            <td><?php echo CHtml::value($one, 'receiverInfo.receiver')?></td>
                            <td>￥<?php echo CHtml::value($one, 'total')?></td>
                            <td><?php echo $one->stateHandle->lookup()?></td>
                            <td><?php echo $one->payStatus ?></td>
                            <?php $this->widget('lib.ext.data.DataWidget',array(
                            	'model' => $one,
                            	'view' => 'application.modules.mall.views.center.button'
                            ))?>
                          </tr>
                     	  <?php endforeach;?>
                    </table>

                </div>
                <div class="bh-c-shuizi1-c-yy bh-mLeft20 bh-fr">
                    <?php $this->widget('LyLinkPager',array(
                    	'pages' => $data->pagination,
                    ))?>
                </div>
			</div>
			<div class="bh-space"></div>
		</div>
	</div>
<script>
	$('.btn-comment').click(function() {
		dlg = $.dialog({
			title: '订单点评',
			fixed: true,
			button: [{
				value: '提交',
				callback: function() {
					$form = this.dom.content.find('form');
					action = $form.attr('action');
					$.post(action, $form.serialize(), function(data) {
						if(!data.error) {
							alert('提交成功');
							window.location.reload();
						} else {
							$.alert(data.error);
						}
					}, 'json');
					return false;
				}
			}, {
				value: '取消'
			}]
		});
		$.get(this.href, {}, function(result) {
			dlg.content(result);

		})
		return false;
	})
</script>